import 'package:get_it/get_it.dart';
import 'package:mobile_app.home.collections/all_lexical_item_page/domain/use_cases/filter_lexical_items/use_case.dart';
import 'package:mobile_app.home.collections/all_lexical_item_page/domain/use_cases/get_initial_data/use_case.dart';
import 'package:mobile_app.home.collections/all_lexical_item_page/domain/use_cases/handle_learning_content_outer_update/use_case.dart';
import 'package:mobile_app.home.collections/all_lexical_item_page/domain/use_cases/handle_premium_access_status_outer_update/use_case.dart';
import 'package:mobile_app.home.collections.core/injection_container.dart' as collection_core_di;
import 'package:mobile_app.home.core/injection_container.dart' as home_core_di;

final sl = GetIt.asNewInstance();

Future<void> init() async {
  // use cases

  sl.registerLazySingleton<FilterLexicalItems>(() {
    return FilterLexicalItemsImpl(
      sortLexicalItems: home_core_di.sl(),
      filterLexicalItemsByPrefix: collection_core_di.sl(),
      isLexicalItemTitlePrefix: collection_core_di.sl(),
    );
  });

  sl.registerLazySingleton<GetInitialData>(() {
    return GetInitialDataImpl(
      sortLexicalItems: home_core_di.sl(),
      isLexicalItemTitlePrefix: collection_core_di.sl(),
      getLexicalItemProgressPercentMap: home_core_di.sl(),
      getPermittedCollectionListItemIds: home_core_di.sl(),
      getPermittedLexicalItemIds: home_core_di.sl(),
    );
  });

  sl.registerLazySingleton<HandleLearningContentOuterUpdate>(() {
    return HandleLearningContentOuterUpdateImpl(
      sortLexicalItems: home_core_di.sl(),
      filterLexicalItemsByPrefix: collection_core_di.sl(),
      isLexicalItemTitlePrefix: collection_core_di.sl(),
      getLexicalItemProgressPercentMap: home_core_di.sl(),
      getPermittedCollectionListItemIds: home_core_di.sl(),
      getPermittedLexicalItemIds: home_core_di.sl(),
    );
  });

  sl.registerLazySingleton<HandlePremiumAccessStatusOuterUpdate>(() {
    return HandlePremiumAccessStatusOuterUpdateImpl(
      getPermittedCollectionListItemIds: home_core_di.sl(),
      getPermittedLexicalItemIds: home_core_di.sl(),
    );
  });
}
